home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Hardware / PowerManager DDK 1.0f1 / Interfaces&Libraries / Interfaces / MacMemory.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-08  |  33.5 KB  |  923 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        MacMemory.h
  3.  
  4.      Contains:    Memory Manager Interfaces.
  5.  
  6.      Version:    System 8.5
  7.  
  8.      DRI:        Jerry Godes?
  9.  
  10.      Copyright:    © 1985-1999 by Apple Computer, Inc., all rights reserved
  11.  
  12.      Warning:    *** APPLE INTERNAL USE ONLY ***
  13.                  This file may contain unreleased API's
  14.  
  15.      BuildInfo:    Built by:            Scott Johnson
  16.                  On:                    10/8/99 11:26 AM
  17.                  With Interfacer:    3.0d13   (MPW PowerPC)
  18.                  From:                MacMemory.i
  19.                      Revision:        63
  20.                      Dated:            5/1/99
  21.                      Last change by:    JL
  22.                      Last comment:    [2270364]  Added GetVolumeVirtualMemoryInfo.
  23.  
  24.      Bugs:        Report bugs to Radar component "System Interfaces", "Latest"
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28. #ifndef __MACMEMORY__
  29. #define __MACMEMORY__
  30.  
  31.  
  32. #ifndef __MACTYPES__
  33. #include <MacTypes.h>
  34. #endif
  35.  
  36. #ifndef __MIXEDMODE__
  37. #include <MixedMode.h>
  38. #endif
  39.  
  40.  
  41.  
  42.  
  43. #if PRAGMA_ONCE
  44. #pragma once
  45. #endif
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. #if PRAGMA_IMPORT
  52. #pragma import on
  53. #endif
  54.  
  55. #if PRAGMA_STRUCT_ALIGN
  56.     #pragma options align=mac68k
  57. #elif PRAGMA_STRUCT_PACKPUSH
  58.     #pragma pack(push, 2)
  59. #elif PRAGMA_STRUCT_PACK
  60.     #pragma pack(2)
  61. #endif
  62.  
  63.  
  64. enum {
  65.     maxSize                        = 0x7FFFFFF0                    /*the largest block possible*/
  66. };
  67.  
  68. enum {
  69.     defaultPhysicalEntryCount    = 8
  70. };
  71.  
  72. enum {
  73.                                                                 /* values returned from the GetPageState function */
  74.     kPageInMemory                = 0,
  75.     kPageOnDisk                    = 1,
  76.     kNotPaged                    = 2
  77. };
  78.  
  79. enum {
  80.                                                                 /* masks for Zone->heapType field */
  81.     k32BitHeap                    = 1,                            /* valid in all Memory Managers */
  82.     kNewStyleHeap                = 2,                            /* true if new Heap Manager is present */
  83.     kNewDebugHeap                = 4                                /* true if new Heap Manager is running in debug mode on this heap */
  84. };
  85.  
  86. /* Note: The type "Size" moved to Types.h */
  87.  
  88.  
  89. typedef CALLBACK_API( long , GrowZoneProcPtr )(Size cbNeeded);
  90. typedef CALLBACK_API( void , PurgeProcPtr )(Handle blockToPurge);
  91. typedef CALLBACK_API( void , UserFnProcPtr )(void *parameter);
  92. /*
  93.     WARNING: UserFnProcPtr uses register based parameters under classic 68k
  94.              and cannot be written in a high-level language without 
  95.              the help of mixed mode or assembly glue.
  96. */
  97. typedef STACK_UPP_TYPE(GrowZoneProcPtr)                         GrowZoneUPP;
  98. typedef STACK_UPP_TYPE(PurgeProcPtr)                             PurgeUPP;
  99. typedef REGISTER_UPP_TYPE(UserFnProcPtr)                         UserFnUPP;
  100.  
  101. struct Zone {
  102.     Ptr                             bkLim;
  103.     Ptr                             purgePtr;
  104.     Ptr                             hFstFree;
  105.     long                             zcbFree;
  106.     GrowZoneUPP                     gzProc;
  107.     short                             moreMast;
  108.     short                             flags;
  109.     short                             cntRel;
  110.     short                             maxRel;
  111.     short                             cntNRel;
  112.     SInt8                             heapType;                    /* previously "maxNRel", now holds flags (e.g. k32BitHeap)*/
  113.     SInt8                             unused;
  114.     short                             cntEmpty;
  115.     short                             cntHandles;
  116.     long                             minCBFree;
  117.     PurgeUPP                         purgeProc;
  118.     Ptr                             sparePtr;
  119.     Ptr                             allocPtr;
  120.     short                             heapData;
  121. };
  122. typedef struct Zone                        Zone;
  123.  
  124. typedef Zone *                            THz;
  125.  
  126. struct MemoryBlock {
  127.     void *                            address;
  128.     unsigned long                     count;
  129. };
  130. typedef struct MemoryBlock                MemoryBlock;
  131.  
  132. struct LogicalToPhysicalTable {
  133.     MemoryBlock                     logical;
  134.     MemoryBlock                     physical[8];
  135. };
  136. typedef struct LogicalToPhysicalTable    LogicalToPhysicalTable;
  137.  
  138. typedef short                             PageState;
  139. typedef short                             StatusRegisterContents;
  140. enum {
  141.     kVolumeVirtualMemoryInfoVersion1 = 1                        /* first version of VolumeVirtualMemoryInfo*/
  142. };
  143.  
  144.  
  145. struct VolumeVirtualMemoryInfo {
  146.     PBVersion                         version;                    /* Input: Version of the VolumeVirtualMemoryInfo structure*/
  147.     SInt16                             volumeRefNum;                /* Input: volume reference number*/
  148.     Boolean                         inUse;                        /* output: true if volume is currently used for file mapping*/
  149.     UInt8                             _fill;
  150.     UInt32                             vmOptions;                    /* output: tells what volume can support (same as DriverGestaltVMOptionsResponse vmOptions bits in DriverGestalt)*/
  151.                                                                 /* end of kVolumeVirtualMemoryInfoVersion1 structure*/
  152. };
  153. typedef struct VolumeVirtualMemoryInfo    VolumeVirtualMemoryInfo;
  154. typedef VolumeVirtualMemoryInfo *        VolumeVirtualMemoryInfoPtr;
  155. #if OPAQUE_UPP_TYPES
  156.     EXTERN_API(GrowZoneUPP)
  157.     NewGrowZoneUPP                   (GrowZoneProcPtr            userRoutine);
  158.  
  159.     EXTERN_API(PurgeUPP)
  160.     NewPurgeUPP                       (PurgeProcPtr            userRoutine);
  161.  
  162.     EXTERN_API(UserFnUPP)
  163.     NewUserFnUPP                   (UserFnProcPtr            userRoutine);
  164.  
  165.     EXTERN_API(void)
  166.     DisposeGrowZoneUPP               (GrowZoneUPP                userUPP);
  167.  
  168.     EXTERN_API(void)
  169.     DisposePurgeUPP                   (PurgeUPP                userUPP);
  170.  
  171.     EXTERN_API(void)
  172.     DisposeUserFnUPP               (UserFnUPP                userUPP);
  173.  
  174.     EXTERN_API(long)
  175.     InvokeGrowZoneUPP               (Size                    cbNeeded,
  176.                                     GrowZoneUPP                userUPP);
  177.  
  178.     EXTERN_API(void)
  179.     InvokePurgeUPP                   (Handle                    blockToPurge,
  180.                                     PurgeUPP                userUPP);
  181.  
  182.     EXTERN_API(void)
  183.     InvokeUserFnUPP                   (void *                    parameter,
  184.                                     UserFnUPP                userUPP);
  185.  
  186. #else
  187.     enum { uppGrowZoneProcInfo = 0x000000F0 };                         /* pascal 4_bytes Func(4_bytes) */
  188.     enum { uppPurgeProcInfo = 0x000000C0 };                         /* pascal no_return_value Func(4_bytes) */
  189.     enum { uppUserFnProcInfo = 0x00009802 };                         /* register no_return_value Func(4_bytes:A0) */
  190.     #define NewGrowZoneUPP(userRoutine)                             (GrowZoneUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGrowZoneProcInfo, GetCurrentArchitecture())
  191.     #define NewPurgeUPP(userRoutine)                                 (PurgeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPurgeProcInfo, GetCurrentArchitecture())
  192.     #define NewUserFnUPP(userRoutine)                                 (UserFnUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserFnProcInfo, GetCurrentArchitecture())
  193.     #define DisposeGrowZoneUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  194.     #define DisposePurgeUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  195.     #define DisposeUserFnUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  196.     #define InvokeGrowZoneUPP(cbNeeded, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppGrowZoneProcInfo, (cbNeeded))
  197.     #define InvokePurgeUPP(blockToPurge, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppPurgeProcInfo, (blockToPurge))
  198.     #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  199.     #pragma parameter InvokeUserFnUPP(__A0, __A1)
  200.     void InvokeUserFnUPP(void * parameter, UserFnUPP userUPP) = 0x4E91;
  201.     #else
  202.         #define InvokeUserFnUPP(parameter, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppUserFnProcInfo, (parameter))
  203.     #endif
  204. #endif
  205. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  206. #define NewGrowZoneProc(userRoutine)                             NewGrowZoneUPP(userRoutine)
  207. #define NewPurgeProc(userRoutine)                                 NewPurgeUPP(userRoutine)
  208. #define NewUserFnProc(userRoutine)                                 NewUserFnUPP(userRoutine)
  209. #define CallGrowZoneProc(userRoutine, cbNeeded)                    InvokeGrowZoneUPP(cbNeeded, userRoutine)
  210. #define CallPurgeProc(userRoutine, blockToPurge)                InvokePurgeUPP(blockToPurge, userRoutine)
  211. #define CallUserFnProc(userRoutine, parameter)                    InvokeUserFnUPP(parameter, userRoutine)
  212. EXTERN_API( Ptr )
  213. GetApplLimit                    (void)                                                        TWOWORDINLINE(0x2EB8, 0x0130);
  214.  
  215. EXTERN_API( THz )
  216. SystemZone                        (void)                                                        TWOWORDINLINE(0x2EB8, 0x02A6);
  217.  
  218. EXTERN_API( THz )
  219. ApplicationZone                    (void)                                                        TWOWORDINLINE(0x2EB8, 0x02AA);
  220.  
  221. EXTERN_API( Handle )
  222. GZSaveHnd                        (void)                                                        TWOWORDINLINE(0x2EB8, 0x0328);
  223.  
  224. EXTERN_API( Ptr )
  225. TopMem                            (void)                                                        TWOWORDINLINE(0x2EB8, 0x0108);
  226.  
  227. EXTERN_API( OSErr )
  228. MemError                        (void)                                                        TWOWORDINLINE(0x3EB8, 0x0220);
  229.  
  230.  
  231.  
  232.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  233.                                                                                             #pragma parameter __A0 GetZone
  234.                                                                                             #endif
  235. EXTERN_API( THz )
  236. GetZone                            (void)                                                        ONEWORDINLINE(0xA11A);
  237.  
  238.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  239.                                                                                             #pragma parameter __A0 NewHandle(__D0)
  240.                                                                                             #endif
  241. EXTERN_API( Handle )
  242. NewHandle                        (Size                     byteCount)                            ONEWORDINLINE(0xA122);
  243.  
  244.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  245.                                                                                             #pragma parameter __A0 NewHandleSys(__D0)
  246.                                                                                             #endif
  247. EXTERN_API( Handle )
  248. NewHandleSys                    (Size                     byteCount)                            ONEWORDINLINE(0xA522);
  249.  
  250.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  251.                                                                                             #pragma parameter __A0 NewHandleClear(__D0)
  252.                                                                                             #endif
  253. EXTERN_API( Handle )
  254. NewHandleClear                    (Size                     byteCount)                            ONEWORDINLINE(0xA322);
  255.  
  256.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  257.                                                                                             #pragma parameter __A0 NewHandleSysClear(__D0)
  258.                                                                                             #endif
  259. EXTERN_API( Handle )
  260. NewHandleSysClear                (Size                     byteCount)                            ONEWORDINLINE(0xA722);
  261.  
  262.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  263.                                                                                             #pragma parameter __A0 HandleZone(__A0)
  264.                                                                                             #endif
  265. EXTERN_API( THz )
  266. HandleZone                        (Handle                 h)                                    ONEWORDINLINE(0xA126);
  267.  
  268.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  269.                                                                                             #pragma parameter __A0 RecoverHandle(__A0)
  270.                                                                                             #endif
  271. EXTERN_API( Handle )
  272. RecoverHandle                    (Ptr                     p)                                    ONEWORDINLINE(0xA128);
  273.  
  274.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  275.                                                                                             #pragma parameter __A0 RecoverHandleSys(__A0)
  276.                                                                                             #endif
  277. EXTERN_API( Handle )
  278. RecoverHandleSys                (Ptr                     p)                                    ONEWORDINLINE(0xA528);
  279.  
  280.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  281.                                                                                             #pragma parameter __A0 NewPtr(__D0)
  282.                                                                                             #endif
  283. EXTERN_API( Ptr )
  284. NewPtr                            (Size                     byteCount)                            ONEWORDINLINE(0xA11E);
  285.  
  286.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  287.                                                                                             #pragma parameter __A0 NewPtrSys(__D0)
  288.                                                                                             #endif
  289. EXTERN_API( Ptr )
  290. NewPtrSys                        (Size                     byteCount)                            ONEWORDINLINE(0xA51E);
  291.  
  292.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  293.                                                                                             #pragma parameter __A0 NewPtrClear(__D0)
  294.                                                                                             #endif
  295. EXTERN_API( Ptr )
  296. NewPtrClear                        (Size                     byteCount)                            ONEWORDINLINE(0xA31E);
  297.  
  298.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  299.                                                                                             #pragma parameter __A0 NewPtrSysClear(__D0)
  300.                                                                                             #endif
  301. EXTERN_API( Ptr )
  302. NewPtrSysClear                    (Size                     byteCount)                            ONEWORDINLINE(0xA71E);
  303.  
  304.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  305.                                                                                             #pragma parameter __A0 PtrZone(__A0)
  306.                                                                                             #endif
  307. EXTERN_API( THz )
  308. PtrZone                            (Ptr                     p)                                    ONEWORDINLINE(0xA148);
  309.  
  310.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  311.                                                                                             #pragma parameter __D0 MaxBlock
  312.                                                                                             #endif
  313. EXTERN_API( long )
  314. MaxBlock                        (void)                                                        ONEWORDINLINE(0xA061);
  315.  
  316.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  317.                                                                                             #pragma parameter __D0 MaxBlockSys
  318.                                                                                             #endif
  319. EXTERN_API( long )
  320. MaxBlockSys                        (void)                                                        ONEWORDINLINE(0xA461);
  321.  
  322.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  323.                                                                                             #pragma parameter __D0 StackSpace
  324.                                                                                             #endif
  325. EXTERN_API( long )
  326. StackSpace                        (void)                                                        ONEWORDINLINE(0xA065);
  327.  
  328.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  329.                                                                                             #pragma parameter __A0 NewEmptyHandle
  330.                                                                                             #endif
  331. EXTERN_API( Handle )
  332. NewEmptyHandle                    (void)                                                        ONEWORDINLINE(0xA166);
  333.  
  334.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  335.                                                                                             #pragma parameter __A0 NewEmptyHandleSys
  336.                                                                                             #endif
  337. EXTERN_API( Handle )
  338. NewEmptyHandleSys                (void)                                                        ONEWORDINLINE(0xA566);
  339.  
  340.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  341.                                                                                             #pragma parameter HLock(__A0)
  342.                                                                                             #endif
  343. EXTERN_API( void )
  344. HLock                            (Handle                 h)                                    ONEWORDINLINE(0xA029);
  345.  
  346.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  347.                                                                                             #pragma parameter HUnlock(__A0)
  348.                                                                                             #endif
  349. EXTERN_API( void )
  350. HUnlock                            (Handle                 h)                                    ONEWORDINLINE(0xA02A);
  351.  
  352.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  353.                                                                                             #pragma parameter HPurge(__A0)
  354.                                                                                             #endif
  355. EXTERN_API( void )
  356. HPurge                            (Handle                 h)                                    ONEWORDINLINE(0xA049);
  357.  
  358.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  359.                                                                                             #pragma parameter HNoPurge(__A0)
  360.                                                                                             #endif
  361. EXTERN_API( void )
  362. HNoPurge                        (Handle                 h)                                    ONEWORDINLINE(0xA04A);
  363.  
  364.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  365.                                                                                             #pragma parameter HLockHi(__A0)
  366.                                                                                             #endif
  367. EXTERN_API( void )
  368. HLockHi                            (Handle                 h)                                    TWOWORDINLINE(0xA064, 0xA029);
  369.  
  370. EXTERN_API( Handle )
  371. TempNewHandle                    (Size                     logicalSize,
  372.                                  OSErr *                resultCode)                            THREEWORDINLINE(0x3F3C, 0x001D, 0xA88F);
  373.  
  374. EXTERN_API( Size )
  375. TempMaxMem                        (Size *                    grow)                                THREEWORDINLINE(0x3F3C, 0x0015, 0xA88F);
  376.  
  377. EXTERN_API( long )
  378. TempFreeMem                        (void)                                                        THREEWORDINLINE(0x3F3C, 0x0018, 0xA88F);
  379.  
  380. EXTERN_API( void )
  381. InitZone                        (GrowZoneUPP             pgrowZone,
  382.                                  short                     cmoreMasters,
  383.                                  void *                    limitPtr,
  384.                                  void *                    startPtr);
  385.  
  386.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  387.                                                                                             #pragma parameter SetZone(__A0)
  388.                                                                                             #endif
  389. EXTERN_API( void )
  390. SetZone                            (THz                     hz)                                    ONEWORDINLINE(0xA01B);
  391.  
  392.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  393.                                                                                             #pragma parameter __D0 CompactMem(__D0)
  394.                                                                                             #endif
  395. EXTERN_API( Size )
  396. CompactMem                        (Size                     cbNeeded)                            ONEWORDINLINE(0xA04C);
  397.  
  398.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  399.                                                                                             #pragma parameter __D0 CompactMemSys(__D0)
  400.                                                                                             #endif
  401. EXTERN_API( Size )
  402. CompactMemSys                    (Size                     cbNeeded)                            ONEWORDINLINE(0xA44C);
  403.  
  404.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  405.                                                                                             #pragma parameter PurgeMem(__D0)
  406.                                                                                             #endif
  407. EXTERN_API( void )
  408. PurgeMem                        (Size                     cbNeeded)                            ONEWORDINLINE(0xA04D);
  409.  
  410.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  411.                                                                                             #pragma parameter PurgeMemSys(__D0)
  412.                                                                                             #endif
  413. EXTERN_API( void )
  414. PurgeMemSys                        (Size                     cbNeeded)                            ONEWORDINLINE(0xA44D);
  415.  
  416.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  417.                                                                                             #pragma parameter __D0 FreeMem
  418.                                                                                             #endif
  419. EXTERN_API( long )
  420. FreeMem                            (void)                                                        ONEWORDINLINE(0xA01C);
  421.  
  422.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  423.                                                                                             #pragma parameter __D0 FreeMemSys
  424.                                                                                             #endif
  425. EXTERN_API( long )
  426. FreeMemSys                        (void)                                                        ONEWORDINLINE(0xA41C);
  427.  
  428.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  429.                                                                                             #pragma parameter ReserveMem(__D0)
  430.                                                                                             #endif
  431. EXTERN_API( void )
  432. ReserveMem                        (Size                     cbNeeded)                            ONEWORDINLINE(0xA040);
  433.  
  434.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  435.                                                                                             #pragma parameter ReserveMemSys(__D0)
  436.                                                                                             #endif
  437. EXTERN_API( void )
  438. ReserveMemSys                    (Size                     cbNeeded)                            ONEWORDINLINE(0xA440);
  439.  
  440.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  441.                                                                                             #pragma parameter __D0 MaxMem(__A1)
  442.                                                                                             #endif
  443. EXTERN_API( Size )
  444. MaxMem                            (Size *                    grow)                                TWOWORDINLINE(0xA11D, 0x2288);
  445.  
  446.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  447.                                                                                             #pragma parameter __D0 MaxMemSys(__A1)
  448.                                                                                             #endif
  449. EXTERN_API( Size )
  450. MaxMemSys                        (Size *                    grow)                                TWOWORDINLINE(0xA51D, 0x2288);
  451.  
  452.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  453.                                                                                             #pragma parameter SetGrowZone(__A0)
  454.                                                                                             #endif
  455. EXTERN_API( void )
  456. SetGrowZone                        (GrowZoneUPP             growZone)                            ONEWORDINLINE(0xA04B);
  457.  
  458.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  459.                                                                                             #pragma parameter MoveHHi(__A0)
  460.                                                                                             #endif
  461. EXTERN_API( void )
  462. MoveHHi                            (Handle                 h)                                    ONEWORDINLINE(0xA064);
  463.  
  464.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  465.                                                                                             #pragma parameter DisposePtr(__A0)
  466.                                                                                             #endif
  467. EXTERN_API( void )
  468. DisposePtr                        (Ptr                     p)                                    ONEWORDINLINE(0xA01F);
  469.  
  470. EXTERN_API( Size )
  471. GetPtrSize                        (Ptr                     p);
  472.  
  473.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  474.                                                                                             #pragma parameter SetPtrSize(__A0, __D0)
  475.                                                                                             #endif
  476. EXTERN_API( void )
  477. SetPtrSize                        (Ptr                     p,
  478.                                  Size                     newSize)                            ONEWORDINLINE(0xA020);
  479.  
  480.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  481.                                                                                             #pragma parameter DisposeHandle(__A0)
  482.                                                                                             #endif
  483. EXTERN_API( void )
  484. DisposeHandle                    (Handle                 h)                                    ONEWORDINLINE(0xA023);
  485.  
  486.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  487.                                                                                             #pragma parameter SetHandleSize(__A0, __D0)
  488.                                                                                             #endif
  489. EXTERN_API( void )
  490. SetHandleSize                    (Handle                 h,
  491.                                  Size                     newSize)                            ONEWORDINLINE(0xA024);
  492.  
  493. /* 
  494.     NOTE
  495.     
  496.     GetHandleSize and GetPtrSize are documented in Inside Mac as returning 0 
  497.     in case of an error, but the traps actually return an error code in D0.
  498.     The glue sets D0 to 0 if an error occured.
  499. */
  500. EXTERN_API( Size )
  501. GetHandleSize                    (Handle                 h);
  502.  
  503.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  504.                                                                                             #pragma parameter __D0 InlineGetHandleSize(__A0)
  505.                                                                                             #endif
  506. EXTERN_API( Size )
  507. InlineGetHandleSize                (Handle                 h)                                    ONEWORDINLINE(0xA025);
  508.  
  509.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  510.                                                                                             #pragma parameter ReallocateHandle(__A0, __D0)
  511.                                                                                             #endif
  512. EXTERN_API( void )
  513. ReallocateHandle                (Handle                 h,
  514.                                  Size                     byteCount)                            ONEWORDINLINE(0xA027);
  515.  
  516.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  517.                                                                                             #pragma parameter ReallocateHandleSys(__A0, __D0)
  518.                                                                                             #endif
  519. EXTERN_API( void )
  520. ReallocateHandleSys                (Handle                 h,
  521.                                  Size                     byteCount)                            ONEWORDINLINE(0xA427);
  522.  
  523.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  524.                                                                                             #pragma parameter EmptyHandle(__A0)
  525.                                                                                             #endif
  526. EXTERN_API( void )
  527. EmptyHandle                        (Handle                 h)                                    ONEWORDINLINE(0xA02B);
  528.  
  529.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  530.                                                                                             #pragma parameter HSetRBit(__A0)
  531.                                                                                             #endif
  532. EXTERN_API( void )
  533. HSetRBit                        (Handle                 h)                                    ONEWORDINLINE(0xA067);
  534.  
  535.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  536.                                                                                             #pragma parameter HClrRBit(__A0)
  537.                                                                                             #endif
  538. EXTERN_API( void )
  539. HClrRBit                        (Handle                 h)                                    ONEWORDINLINE(0xA068);
  540.  
  541.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  542.                                                                                             #pragma parameter __D0 HGetState(__A0)
  543.                                                                                             #endif
  544. EXTERN_API( SInt8 )
  545. HGetState                        (Handle                 h)                                    ONEWORDINLINE(0xA069);
  546.  
  547.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  548.                                                                                             #pragma parameter HSetState(__A0, __D0)
  549.                                                                                             #endif
  550. EXTERN_API( void )
  551. HSetState                        (Handle                 h,
  552.                                  SInt8                     flags)                                ONEWORDINLINE(0xA06A);
  553.  
  554. EXTERN_API( void )
  555. PurgeSpace                        (long *                    total,
  556.                                  long *                    contig);
  557.  
  558. /*
  559.     PurgeSpaceTotal and PurgeSpaceContiguous are currently only implement
  560.     on classic 68K.  The are the same as PurgeSpace() but return just
  561.     one value (either total space purgable or contiguous space purgable).
  562.     Begining in Mac OS 8.5 they are available in InterfaceLib.
  563. */
  564.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  565.                                                                                             #pragma parameter __A0 PurgeSpaceTotal
  566.                                                                                             #endif
  567. EXTERN_API( long )
  568. PurgeSpaceTotal                    (void)                                                        ONEWORDINLINE(0xA062);
  569.  
  570.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  571.                                                                                             #pragma parameter __D0 PurgeSpaceContiguous
  572.                                                                                             #endif
  573. EXTERN_API( long )
  574. PurgeSpaceContiguous            (void)                                                        ONEWORDINLINE(0xA062);
  575.  
  576.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  577.                                                                                             #pragma parameter __A0 PurgeSpaceSysTotal
  578.                                                                                             #endif
  579. EXTERN_API( long )
  580. PurgeSpaceSysTotal                (void)                                                        ONEWORDINLINE(0xA562);
  581.  
  582.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  583.                                                                                             #pragma parameter __D0 PurgeSpaceSysContiguous
  584.                                                                                             #endif
  585. EXTERN_API( long )
  586. PurgeSpaceSysContiguous            (void)                                                        ONEWORDINLINE(0xA562);
  587.  
  588.  
  589. /*****************************************************************************
  590.  
  591.     The routines: 
  592.  
  593.         BlockMoveUncached, BlockMoveDataUncached
  594.         BlockZero, BlockZeroUncached
  595.     
  596.     were first created for developers writing drivers. Originally they only
  597.     existed in DriverServicesLib.  Later they were added to InterfaceLib 
  598.     in PCI based PowerMacs.  MacOS 8.5 provides these routines in InterfaceLib
  599.     on all supported machines. 
  600.     
  601. *****************************************************************************/
  602.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  603.                                                                                             #pragma parameter BlockMove(__A0, __A1, __D0)
  604.                                                                                             #endif
  605. EXTERN_API( void )
  606. BlockMove                        (const void *            srcPtr,
  607.                                  void *                    destPtr,
  608.                                  Size                     byteCount)                            ONEWORDINLINE(0xA02E);
  609.  
  610.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  611.                                                                                             #pragma parameter BlockMoveData(__A0, __A1, __D0)
  612.                                                                                             #endif
  613. EXTERN_API( void )
  614. BlockMoveData                    (const void *            srcPtr,
  615.                                  void *                    destPtr,
  616.                                  Size                     byteCount)                            ONEWORDINLINE(0xA22E);
  617.  
  618. EXTERN_API_C( void )
  619. BlockMoveUncached                (const void *            srcPtr,
  620.                                  void *                    destPtr,
  621.                                  Size                     byteCount);
  622.  
  623. EXTERN_API_C( void )
  624. BlockMoveDataUncached            (const void *            srcPtr,
  625.                                  void *                    destPtr,
  626.                                  Size                     byteCount);
  627.  
  628. EXTERN_API_C( void )
  629. BlockZero                        (void *                    destPtr,
  630.                                  Size                     byteCount);
  631.  
  632. EXTERN_API_C( void )
  633. BlockZeroUncached                (void *                    destPtr,
  634.                                  Size                     byteCount);
  635.  
  636.  
  637. EXTERN_API( void )
  638. MaxApplZone                        (void)                                                        ONEWORDINLINE(0xA063);
  639.  
  640.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  641.                                                                                             #pragma parameter SetApplBase(__A0)
  642.                                                                                             #endif
  643. EXTERN_API( void )
  644. SetApplBase                        (void *                    startPtr)                            ONEWORDINLINE(0xA057);
  645.  
  646. EXTERN_API( void )
  647. MoreMasters                        (void)                                                        ONEWORDINLINE(0xA036);
  648.  
  649.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  650.                                                                                             #pragma parameter SetApplLimit(__A0)
  651.                                                                                             #endif
  652. EXTERN_API( void )
  653. SetApplLimit                    (void *                    zoneLimit)                            ONEWORDINLINE(0xA02D);
  654.  
  655. EXTERN_API( void )
  656. InitApplZone                    (void)                                                        ONEWORDINLINE(0xA02C);
  657.  
  658.  
  659. /*  Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  */
  660. EXTERN_API( void )
  661. TempHLock                        (Handle                 h,
  662.                                  OSErr *                resultCode)                            THREEWORDINLINE(0x3F3C, 0x001E, 0xA88F);
  663.  
  664. EXTERN_API( void )
  665. TempHUnlock                        (Handle                 h,
  666.                                  OSErr *                resultCode)                            THREEWORDINLINE(0x3F3C, 0x001F, 0xA88F);
  667.  
  668. EXTERN_API( void )
  669. TempDisposeHandle                (Handle                 h,
  670.                                  OSErr *                resultCode)                            THREEWORDINLINE(0x3F3C, 0x0020, 0xA88F);
  671.  
  672. EXTERN_API( Ptr )
  673. TempTopMem                        (void)                                                        THREEWORDINLINE(0x3F3C, 0x0016, 0xA88F);
  674.  
  675.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  676.                                                                                             #pragma parameter __D0 HoldMemory(__A0, __A1)
  677.                                                                                             #endif
  678. EXTERN_API( OSErr )
  679. HoldMemory                        (void *                    address,
  680.                                  unsigned long             count)                                TWOWORDINLINE(0x7000, 0xA05C);
  681.  
  682.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  683.                                                                                             #pragma parameter __D0 UnholdMemory(__A0, __A1)
  684.                                                                                             #endif
  685. EXTERN_API( OSErr )
  686. UnholdMemory                    (void *                    address,
  687.                                  unsigned long             count)                                TWOWORDINLINE(0x7001, 0xA05C);
  688.  
  689.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  690.                                                                                             #pragma parameter __D0 LockMemory(__A0, __A1)
  691.                                                                                             #endif
  692. EXTERN_API( OSErr )
  693. LockMemory                        (void *                    address,
  694.                                  unsigned long             count)                                TWOWORDINLINE(0x7002, 0xA05C);
  695.  
  696.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  697.                                                                                             #pragma parameter __D0 LockMemoryForOutput(__A0, __A1)
  698.                                                                                             #endif
  699. EXTERN_API( OSErr )
  700. LockMemoryForOutput                (void *                    address,
  701.                                  unsigned long             count)                                TWOWORDINLINE(0x700A, 0xA05C);
  702.  
  703.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  704.                                                                                             #pragma parameter __D0 LockMemoryContiguous(__A0, __A1)
  705.                                                                                             #endif
  706. EXTERN_API( OSErr )
  707. LockMemoryContiguous            (void *                    address,
  708.                                  unsigned long             count)                                TWOWORDINLINE(0x7004, 0xA05C);
  709.  
  710.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  711.                                                                                             #pragma parameter __D0 UnlockMemory(__A0, __A1)
  712.                                                                                             #endif
  713. EXTERN_API( OSErr )
  714. UnlockMemory                    (void *                    address,
  715.                                  unsigned long             count)                                TWOWORDINLINE(0x7003, 0xA05C);
  716.  
  717.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  718.                                                                                             #pragma parameter __D0 MakeMemoryResident(__A0, __A1)
  719.                                                                                             #endif
  720. EXTERN_API( OSErr )
  721. MakeMemoryResident                (void *                    address,
  722.                                  unsigned long             count)                                TWOWORDINLINE(0x700B, 0xA05C);
  723.  
  724.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  725.                                                                                             #pragma parameter __D0 ReleaseMemoryData(__A0, __A1)
  726.                                                                                             #endif
  727. EXTERN_API( OSErr )
  728. ReleaseMemoryData                (void *                    address,
  729.                                  unsigned long             count)                                TWOWORDINLINE(0x700C, 0xA05C);
  730.  
  731.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  732.                                                                                             #pragma parameter __D0 MakeMemoryNonResident(__A0, __A1)
  733.                                                                                             #endif
  734. EXTERN_API( OSErr )
  735. MakeMemoryNonResident            (void *                    address,
  736.                                  unsigned long             count)                                TWOWORDINLINE(0x700D, 0xA05C);
  737.  
  738.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  739.                                                                                             #pragma parameter __D0 FlushMemory(__A0, __A1)
  740.                                                                                             #endif
  741. EXTERN_API( OSErr )
  742. FlushMemory                        (void *                    address,
  743.                                  unsigned long             count)                                TWOWORDINLINE(0x700E, 0xA05C);
  744.  
  745. EXTERN_API( OSErr )
  746. GetPhysical                        (LogicalToPhysicalTable * addresses,
  747.                                  unsigned long *        physicalEntryCount);
  748.  
  749.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  750.                                                                                             #pragma parameter __D0 GetVolumeVirtualMemoryInfo(__A0)
  751.                                                                                             #endif
  752. EXTERN_API( OSErr )
  753. GetVolumeVirtualMemoryInfo        (VolumeVirtualMemoryInfoPtr  volVMInfo)                        TWOWORDINLINE(0x700F, 0xA05C);
  754.  
  755.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  756.                                                                                             #pragma parameter __D0 DeferUserFn(__A0, __D0)
  757.                                                                                             #endif
  758. EXTERN_API( OSErr )
  759. DeferUserFn                        (UserFnUPP                 userFunction,
  760.                                  void *                    argument)                            ONEWORDINLINE(0xA08F);
  761.  
  762.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  763.                                                                                             #pragma parameter __D0 DebuggerGetMax
  764.                                                                                             #endif
  765. EXTERN_API( long )
  766. DebuggerGetMax                    (void)                                                        TWOWORDINLINE(0x7000, 0xA08D);
  767.  
  768. EXTERN_API( void )
  769. DebuggerEnter                    (void)                                                        TWOWORDINLINE(0x7001, 0xA08D);
  770.  
  771. EXTERN_API( void )
  772. DebuggerExit                    (void)                                                        TWOWORDINLINE(0x7002, 0xA08D);
  773.  
  774. EXTERN_API( void )
  775. DebuggerPoll                    (void)                                                        TWOWORDINLINE(0x7003, 0xA08D);
  776.  
  777.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  778.                                                                                             #pragma parameter __D0 GetPageState(__A0)
  779.                                                                                             #endif
  780. EXTERN_API( PageState )
  781. GetPageState                    (const void *            address)                            TWOWORDINLINE(0x7004, 0xA08D);
  782.  
  783.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  784.                                                                                             #pragma parameter __D0 PageFaultFatal
  785.                                                                                             #endif
  786. EXTERN_API( Boolean )
  787. PageFaultFatal                    (void)                                                        TWOWORDINLINE(0x7005, 0xA08D);
  788.  
  789.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  790.                                                                                             #pragma parameter __D0 DebuggerLockMemory(__A0, __A1)
  791.                                                                                             #endif
  792. EXTERN_API( OSErr )
  793. DebuggerLockMemory                (void *                    address,
  794.                                  unsigned long             count)                                TWOWORDINLINE(0x7006, 0xA08D);
  795.  
  796.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  797.                                                                                             #pragma parameter __D0 DebuggerUnlockMemory(__A0, __A1)
  798.                                                                                             #endif
  799. EXTERN_API( OSErr )
  800. DebuggerUnlockMemory            (void *                    address,
  801.                                  unsigned long             count)                                TWOWORDINLINE(0x7007, 0xA08D);
  802.  
  803.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  804.                                                                                             #pragma parameter __D0 EnterSupervisorMode
  805.                                                                                             #endif
  806. EXTERN_API( StatusRegisterContents )
  807. EnterSupervisorMode                (void)                                                        TWOWORDINLINE(0x7008, 0xA08D);
  808.  
  809.  
  810. /* 
  811.     StripAddress is a trap on classic 68K and the
  812.     identity function on PowerMacs and other OS's.
  813. */
  814. #if TARGET_OS_MAC && TARGET_CPU_68K
  815.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  816.                                                                                             #pragma parameter __D0 StripAddress(__D0)
  817.                                                                                             #endif
  818. EXTERN_API( Ptr )
  819. StripAddress                    (void *                    theAddress)                            ONEWORDINLINE(0xA055);
  820.  
  821. #else
  822. #define StripAddress(x)       ((Ptr)(x))
  823. #endif
  824. /* 
  825.     Translate24To32 is a trap on classic 68K and the
  826.     identity function on PowerMacs and other OS's.
  827. */
  828. #if TARGET_OS_MAC && TARGET_CPU_68K
  829.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  830.                                                                                             #pragma parameter __D0 Translate24To32(__D0)
  831.                                                                                             #endif
  832. EXTERN_API( Ptr )
  833. Translate24To32                    (void *                    addr24)                                ONEWORDINLINE(0xA091);
  834.  
  835. #else
  836. #define Translate24To32(x)       ((Ptr)(x))
  837. #endif
  838. EXTERN_API( OSErr )
  839. HandToHand                        (Handle *                theHndl);
  840.  
  841.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  842.                                                                                             #pragma parameter __D0 PtrToXHand(__A0, __A1, __D0)
  843.                                                                                             #endif
  844. EXTERN_API( OSErr )
  845. PtrToXHand                        (const void *            srcPtr,
  846.                                  Handle                 dstHndl,
  847.                                  long                     size)                                ONEWORDINLINE(0xA9E2);
  848.  
  849. EXTERN_API( OSErr )
  850. PtrToHand                        (const void *            srcPtr,
  851.                                  Handle *                dstHndl,
  852.                                  long                     size);
  853.  
  854.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  855.                                                                                             #pragma parameter __D0 HandAndHand(__A0, __A1)
  856.                                                                                             #endif
  857. EXTERN_API( OSErr )
  858. HandAndHand                        (Handle                 hand1,
  859.                                  Handle                 hand2)                                ONEWORDINLINE(0xA9E4);
  860.  
  861.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  862.                                                                                             #pragma parameter __D0 PtrAndHand(__A0, __A1, __D0)
  863.                                                                                             #endif
  864. EXTERN_API( OSErr )
  865. PtrAndHand                        (const void *            ptr1,
  866.                                  Handle                 hand2,
  867.                                  long                     size)                                ONEWORDINLINE(0xA9EF);
  868.  
  869. /* Carbon routines to aid in debugging. */
  870. /* Checks all applicable heaps for validity */
  871. EXTERN_API( Boolean )
  872. CheckAllHeaps                    (void);
  873.  
  874. /* Checks the application heap for validity */
  875. EXTERN_API( Boolean )
  876. IsHeapValid                        (void);
  877.  
  878. /* It is invalid to pass a NULL or an empty Handle to IsHandleValid */
  879. EXTERN_API( Boolean )
  880. IsHandleValid                    (Handle                 h);
  881.  
  882. /* It is invalid to pass a NULL Pointer to IsPointerValid */
  883. EXTERN_API( Boolean )
  884. IsPointerValid                    (Ptr                     p);
  885.  
  886.  
  887. #if OLDROUTINENAMES
  888. #define ApplicZone() ApplicationZone()
  889. #define MFTempNewHandle(logicalSize, resultCode) TempNewHandle(logicalSize, resultCode)
  890. #define MFMaxMem(grow) TempMaxMem(grow)
  891. #define MFFreeMem() TempFreeMem()
  892. #define MFTempHLock(h, resultCode) TempHLock(h, resultCode)
  893. #define MFTempHUnlock(h, resultCode) TempHUnlock(h, resultCode)
  894. #define MFTempDisposHandle(h, resultCode) TempDisposeHandle(h, resultCode)
  895. #define MFTopMem() TempTopMem()
  896. #define ResrvMem(cbNeeded) ReserveMem(cbNeeded)
  897. #define DisposPtr(p) DisposePtr(p)
  898. #define DisposHandle(h) DisposeHandle(h)
  899. #define ReallocHandle(h, byteCount) ReallocateHandle(h, byteCount)
  900. #endif  /* OLDROUTINENAMES */
  901.  
  902.  
  903. #if PRAGMA_STRUCT_ALIGN
  904.     #pragma options align=reset
  905. #elif PRAGMA_STRUCT_PACKPUSH
  906.     #pragma pack(pop)
  907. #elif PRAGMA_STRUCT_PACK
  908.     #pragma pack()
  909. #endif
  910.  
  911. #ifdef PRAGMA_IMPORT_OFF
  912. #pragma import off
  913. #elif PRAGMA_IMPORT
  914. #pragma import reset
  915. #endif
  916.  
  917. #ifdef __cplusplus
  918. }
  919. #endif
  920.  
  921. #endif /* __MACMEMORY__ */
  922.  
  923.